package br.com.lp3.livraria.controller.clientes;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.com.lp3.livraria.dao.ClienteDao;

@WebServlet(urlPatterns="/view/clientes/visualizar.do")
public class VisualizarClientesServlet extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		ClienteDao clienteDao = new ClienteDao();
		req.setAttribute("clientes", clienteDao.buscartodos());
		
		RequestDispatcher requestDispatcher = req.getRequestDispatcher("visualizar.jsp");
		requestDispatcher.forward(req, resp);
	}
}
